package pl.alef.mindplay.services.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import pl.alef.mindplay.dao.CommentDAO;
import pl.alef.mindplay.model.Comment;
import pl.alef.mindplay.services.CommentService;


@Service("commentService")
public class CommentServiceImpl implements CommentService {

	@Autowired
	@Qualifier("commentDAO")
	CommentDAO commentDAO;

	@Transactional(readOnly=true)
	public List<Comment> list() {
		List<Comment> list = commentDAO.readAll();
		return list;
	}

	@Transactional(readOnly=false)
	public void save(Comment comment) {
		commentDAO.save(comment);		
	}
	
}
